package twoD.hofem;

/**
 * A function u: [-1, 1]^2 -> R^n
 * 
 * @author Matthias Baitsch
 */
public interface FunctionR2ToRn {

	/**
	 * Returns the dimension of the range space.
	 * 
	 * @return n
	 */
	public int getN();

	/**
	 * Evaluates the Jacobian
	 * 
	 * <pre>
	 * | du1/dxi1 du2/dxi1 ... |
	 * | du1/dxi2 du2/dxi2 ... |
	 * </pre>
	 * 
	 * at the specified point.
	 * 
	 * @param xi1
	 *            first coordinate
	 * @param xi2
	 *            second coordinate
	 * @return the Jacobian matrix of size n x 2
	 */
	public double[][] jacobianAt(double xi1, double xi2);

	/**
	 * Computes the function value at the specified point
	 * 
	 * @param xi1
	 *            first coordinate
	 * @param xi2
	 *            second coordinate
	 * @return the function value (array of length n)
	 */
	public double[] valueAt(double xi1, double xi2);
}
